﻿using Server.Constant;
using Server.Framework.Message;
using Server.Model;
using System.Collections.Generic;

namespace Server.Message.Request
{
    /// <summary>
    /// Author: Leil
    /// Description: 新增或编辑请求消息
    /// CreateTime: 2020/5/13 10:07:46
    /// </summary>
    [MessageAttr(MessageId.ADD_EDIT_ROLE)]
    class AddEditRoleReq : RequestBaseMessage
    {
        public RoleDao RoleDao { get; private set; }

        public override void Deserialize(byte[] buffer)
        {
            AddEditRole msg = AddEditRole.Parser.ParseFrom(buffer);
            if (msg.Role != null)
            {
                RoleDao = new RoleDao
                {
                    ID = msg.Role.Id,
                    RoleName = msg.Role.RoleName,
                    Status = msg.Role.Status
                };
            }
        }
    }
}
